import Person from './person.js';
class Student extends Person{
    constructor(id,name,age,klass){
        super(id,name,age);
        this.klass=klass;
    }
    introduce(){
        let result=super.introduce();
        if(this.klass.leader===undefined)
            {result+=` I am a Student. I am at Class ${this.klass.number}.`;
            return result;}
        if(this.name==this.klass.leader.name)
            {result+=` I am a Student. I am Leader of Class ${this.klass.number}.`
            return result;}
    }
}
export default Student;

